package com.xintonghua.hongyi.ui.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xintonghua.base.BuildConfig;
import com.xintonghua.base.ui.BaseFragment;
import com.xintonghua.base.ui.ImageActivity;
import com.xintonghua.base.utils.MyUtils;
import com.xintonghua.base.widget.MyItemTextView;
import com.xintonghua.hongyi.R;
import com.xintonghua.hongyi.ui.user.ClubCardActivity;
import com.xintonghua.hongyi.ui.user.FeedBackActivity;
import com.xintonghua.hongyi.ui.user.MyShareActivity;
import com.xintonghua.hongyi.ui.user.OrderListActivity;
import com.xintonghua.hongyi.ui.user.ProductActivity;
import com.xintonghua.hongyi.ui.user.SettingActivity;
import com.xintonghua.hongyi.ui.user.UserInfoActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 作者：wanxianyi
 * 时间：2018/1/9.
 * 包名：com.xintonghua.hongyi.ui.fragment
 */

public class MyFragment extends BaseFragment {
    @BindView(R.id.iv_setting)
    ImageView ivSetting;
    @BindView(R.id.iv_head)
    ImageView ivHead;
    @BindView(R.id.tv_user_name)
    TextView tvUserName;
    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.rl_red)
    RelativeLayout rlRed;
    @BindView(R.id.utils_club_card)
    MyItemTextView utilsClubCard;
    @BindView(R.id.utils_product_items)
    MyItemTextView utilsProductItems;
    @BindView(R.id.utils_my_order)
    MyItemTextView utilsMyOrder;
    @BindView(R.id.utils_feedback)
    MyItemTextView utilsFeedback;
    @BindView(R.id.utils_share)
    MyItemTextView utilsShare;
    @BindView(R.id.utils_my_share)
    MyItemTextView utilsMyShare;
    Unbinder unbinder;
    @BindView(R.id.ll_user)
    LinearLayout llUser;

    @Override
    public int getLayout() {
        return R.layout.fragment_my;
    }

    @Override
    public void initUI(View view) {
        unbinder = ButterKnife.bind(this, view);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.iv_setting, R.id.utils_club_card, R.id.utils_product_items, R.id.utils_my_order, R.id.utils_feedback, R.id.utils_share, R.id.utils_my_share, R.id.ll_user})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            //设置
            case R.id.iv_setting:
                MyUtils.openActivity(getActivity(), SettingActivity.class);
                break;
            //会员卡
            case R.id.utils_club_card:
                MyUtils.openActivity(getActivity(), ClubCardActivity.class);
                break;
            //产品项目
            case R.id.utils_product_items:
                MyUtils.openActivity(getActivity(), ProductActivity.class);
                break;
            //我的订单
            case R.id.utils_my_order:
                MyUtils.openActivity(getActivity(), OrderListActivity.class);
                break;
            //意见反馈
            case R.id.utils_feedback:
                MyUtils.openActivity(getActivity(), FeedBackActivity.class);
                break;
            // 分享
            case R.id.utils_share:

                break;
            // 我的分享
            case R.id.utils_my_share:
                MyUtils.openActivity(getActivity(), MyShareActivity.class);
                break;
            //用户信息
            case R.id.ll_user:
                MyUtils.openActivity(getActivity(), UserInfoActivity.class);
                break;
        }
    }

}
